import { request } from "../../request/request.js"

Page({
    data: {
        //轮播图
        swiperList: [],
        // 导航数据
        navList: [],
        // 楼层数据
        floorList: []
    },
    //options(Object)
    onLoad: function(options) {
        this.getSwiperList();
        this.getNavList();
        this.getFloorList();
    },
    // 获取轮播图数组
    getSwiperList() {
        request({ url: "/home/swiperdata" })
            .then(result => {
                this.setData({
                    swiperList: result.data.message
                })
                console.log(this.data.swiperList)
            })
    },
    // 获取导航数组
    getNavList() {
        request({ url: "/home/catitems" })
            .then(result => {
                this.setData({
                    navList: result.data.message
                })
                console.log(this.data.navList)
            })
    },
    // 获取楼层数组
    getFloorList() {
        request({ url: "/home/floordata" })
            .then(result => {
                this.setData({
                    floorList: result.data.message
                })
                console.log(this.data.floorList)
            })
    }
});